/*
 * XML Type:  XDBSource
 * Namespace: http://www.seedwill.com/xul/core
 * Java type: com.seedwill.xul.core.XDBSource
 *
 * Automatically generated - do not modify.
 */
package com.seedwill.xul.core.impl;
/**
 * An XML XDBSource(@http://www.seedwill.com/xul/core).
 *
 * This is a complex type.
 */
public class XDBSourceImpl extends com.seedwill.xul.core.impl.XSourceImpl implements com.seedwill.xul.core.XDBSource
{
    private static final long serialVersionUID = 1L;
    
    public XDBSourceImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName DRIVER$0 = 
        new javax.xml.namespace.QName("", "driver");
    private static final javax.xml.namespace.QName URL$2 = 
        new javax.xml.namespace.QName("", "url");
    private static final javax.xml.namespace.QName DB$4 = 
        new javax.xml.namespace.QName("", "db");
    private static final javax.xml.namespace.QName USER$6 = 
        new javax.xml.namespace.QName("", "user");
    private static final javax.xml.namespace.QName PASSWORD$8 = 
        new javax.xml.namespace.QName("", "password");
    private static final javax.xml.namespace.QName EXTENSION$10 = 
        new javax.xml.namespace.QName("", "extension");
    private static final javax.xml.namespace.QName REFERCONTEXT$12 = 
        new javax.xml.namespace.QName("", "referContext");
    private static final javax.xml.namespace.QName REFERCONTEXTTYPE$14 = 
        new javax.xml.namespace.QName("", "referContextType");
    
    
    /**
     * Gets the "driver" element
     */
    public java.lang.String getDriver()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(DRIVER$0, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "driver" element
     */
    public org.apache.xmlbeans.XmlString xgetDriver()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(DRIVER$0, 0);
            return target;
        }
    }
    
    /**
     * True if has "driver" element
     */
    public boolean isSetDriver()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(DRIVER$0) != 0;
        }
    }
    
    /**
     * Sets the "driver" element
     */
    public void setDriver(java.lang.String driver)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(DRIVER$0, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(DRIVER$0);
            }
            target.setStringValue(driver);
        }
    }
    
    /**
     * Sets (as xml) the "driver" element
     */
    public void xsetDriver(org.apache.xmlbeans.XmlString driver)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(DRIVER$0, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlString)get_store().add_element_user(DRIVER$0);
            }
            target.set(driver);
        }
    }
    
    /**
     * Unsets the "driver" element
     */
    public void unsetDriver()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(DRIVER$0, 0);
        }
    }
    
    /**
     * Gets the "url" element
     */
    public java.lang.String getUrl()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(URL$2, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "url" element
     */
    public org.apache.xmlbeans.XmlString xgetUrl()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(URL$2, 0);
            return target;
        }
    }
    
    /**
     * True if has "url" element
     */
    public boolean isSetUrl()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(URL$2) != 0;
        }
    }
    
    /**
     * Sets the "url" element
     */
    public void setUrl(java.lang.String url)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(URL$2, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(URL$2);
            }
            target.setStringValue(url);
        }
    }
    
    /**
     * Sets (as xml) the "url" element
     */
    public void xsetUrl(org.apache.xmlbeans.XmlString url)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(URL$2, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlString)get_store().add_element_user(URL$2);
            }
            target.set(url);
        }
    }
    
    /**
     * Unsets the "url" element
     */
    public void unsetUrl()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(URL$2, 0);
        }
    }
    
    /**
     * Gets the "db" element
     */
    public java.lang.String getDb()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(DB$4, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "db" element
     */
    public org.apache.xmlbeans.XmlString xgetDb()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(DB$4, 0);
            return target;
        }
    }
    
    /**
     * True if has "db" element
     */
    public boolean isSetDb()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(DB$4) != 0;
        }
    }
    
    /**
     * Sets the "db" element
     */
    public void setDb(java.lang.String db)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(DB$4, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(DB$4);
            }
            target.setStringValue(db);
        }
    }
    
    /**
     * Sets (as xml) the "db" element
     */
    public void xsetDb(org.apache.xmlbeans.XmlString db)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(DB$4, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlString)get_store().add_element_user(DB$4);
            }
            target.set(db);
        }
    }
    
    /**
     * Unsets the "db" element
     */
    public void unsetDb()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(DB$4, 0);
        }
    }
    
    /**
     * Gets the "user" element
     */
    public java.lang.String getUser()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(USER$6, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "user" element
     */
    public org.apache.xmlbeans.XmlString xgetUser()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(USER$6, 0);
            return target;
        }
    }
    
    /**
     * True if has "user" element
     */
    public boolean isSetUser()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(USER$6) != 0;
        }
    }
    
    /**
     * Sets the "user" element
     */
    public void setUser(java.lang.String user)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(USER$6, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(USER$6);
            }
            target.setStringValue(user);
        }
    }
    
    /**
     * Sets (as xml) the "user" element
     */
    public void xsetUser(org.apache.xmlbeans.XmlString user)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(USER$6, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlString)get_store().add_element_user(USER$6);
            }
            target.set(user);
        }
    }
    
    /**
     * Unsets the "user" element
     */
    public void unsetUser()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(USER$6, 0);
        }
    }
    
    /**
     * Gets the "password" element
     */
    public java.lang.String getPassword()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(PASSWORD$8, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "password" element
     */
    public org.apache.xmlbeans.XmlString xgetPassword()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(PASSWORD$8, 0);
            return target;
        }
    }
    
    /**
     * True if has "password" element
     */
    public boolean isSetPassword()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(PASSWORD$8) != 0;
        }
    }
    
    /**
     * Sets the "password" element
     */
    public void setPassword(java.lang.String password)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(PASSWORD$8, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(PASSWORD$8);
            }
            target.setStringValue(password);
        }
    }
    
    /**
     * Sets (as xml) the "password" element
     */
    public void xsetPassword(org.apache.xmlbeans.XmlString password)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(PASSWORD$8, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlString)get_store().add_element_user(PASSWORD$8);
            }
            target.set(password);
        }
    }
    
    /**
     * Unsets the "password" element
     */
    public void unsetPassword()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(PASSWORD$8, 0);
        }
    }
    
    /**
     * Gets array of all "extension" elements
     */
    public com.seedwill.xul.core.XPairItem[] getExtensionArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(EXTENSION$10, targetList);
            com.seedwill.xul.core.XPairItem[] result = new com.seedwill.xul.core.XPairItem[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "extension" element
     */
    public com.seedwill.xul.core.XPairItem getExtensionArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.core.XPairItem target = null;
            target = (com.seedwill.xul.core.XPairItem)get_store().find_element_user(EXTENSION$10, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "extension" element
     */
    public int sizeOfExtensionArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(EXTENSION$10);
        }
    }
    
    /**
     * Sets array of all "extension" element
     */
    public void setExtensionArray(com.seedwill.xul.core.XPairItem[] extensionArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(extensionArray, EXTENSION$10);
        }
    }
    
    /**
     * Sets ith "extension" element
     */
    public void setExtensionArray(int i, com.seedwill.xul.core.XPairItem extension)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.core.XPairItem target = null;
            target = (com.seedwill.xul.core.XPairItem)get_store().find_element_user(EXTENSION$10, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(extension);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "extension" element
     */
    public com.seedwill.xul.core.XPairItem insertNewExtension(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.core.XPairItem target = null;
            target = (com.seedwill.xul.core.XPairItem)get_store().insert_element_user(EXTENSION$10, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "extension" element
     */
    public com.seedwill.xul.core.XPairItem addNewExtension()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.core.XPairItem target = null;
            target = (com.seedwill.xul.core.XPairItem)get_store().add_element_user(EXTENSION$10);
            return target;
        }
    }
    
    /**
     * Removes the ith "extension" element
     */
    public void removeExtension(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(EXTENSION$10, i);
        }
    }
    
    /**
     * Gets the "referContext" element
     */
    public java.lang.String getReferContext()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(REFERCONTEXT$12, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "referContext" element
     */
    public org.apache.xmlbeans.XmlString xgetReferContext()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(REFERCONTEXT$12, 0);
            return target;
        }
    }
    
    /**
     * True if has "referContext" element
     */
    public boolean isSetReferContext()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(REFERCONTEXT$12) != 0;
        }
    }
    
    /**
     * Sets the "referContext" element
     */
    public void setReferContext(java.lang.String referContext)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(REFERCONTEXT$12, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(REFERCONTEXT$12);
            }
            target.setStringValue(referContext);
        }
    }
    
    /**
     * Sets (as xml) the "referContext" element
     */
    public void xsetReferContext(org.apache.xmlbeans.XmlString referContext)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(REFERCONTEXT$12, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlString)get_store().add_element_user(REFERCONTEXT$12);
            }
            target.set(referContext);
        }
    }
    
    /**
     * Unsets the "referContext" element
     */
    public void unsetReferContext()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(REFERCONTEXT$12, 0);
        }
    }
    
    /**
     * Gets the "referContextType" element
     */
    public java.lang.String getReferContextType()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(REFERCONTEXTTYPE$14, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "referContextType" element
     */
    public org.apache.xmlbeans.XmlString xgetReferContextType()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(REFERCONTEXTTYPE$14, 0);
            return target;
        }
    }
    
    /**
     * True if has "referContextType" element
     */
    public boolean isSetReferContextType()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(REFERCONTEXTTYPE$14) != 0;
        }
    }
    
    /**
     * Sets the "referContextType" element
     */
    public void setReferContextType(java.lang.String referContextType)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(REFERCONTEXTTYPE$14, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(REFERCONTEXTTYPE$14);
            }
            target.setStringValue(referContextType);
        }
    }
    
    /**
     * Sets (as xml) the "referContextType" element
     */
    public void xsetReferContextType(org.apache.xmlbeans.XmlString referContextType)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(REFERCONTEXTTYPE$14, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlString)get_store().add_element_user(REFERCONTEXTTYPE$14);
            }
            target.set(referContextType);
        }
    }
    
    /**
     * Unsets the "referContextType" element
     */
    public void unsetReferContextType()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(REFERCONTEXTTYPE$14, 0);
        }
    }
}
